<template>
  <Modal
    v-model="show"
    :title="title"
    @on-ok="onOk"
    @on-cancel="onCancel"
    :footer-hide="footerHide"
    :ok-text="okText"
    :cancel-text="cancelText"
    :closable="closeAble"
    :mask-closable="maskCloseAble"
  >

    <p slot="header" :style="titleStyle" :hidden="makeTitle">
      <Icon :type="iconType" :hidden="iconShow"></Icon>
      <span>{{ title }}</span>
    </p>
    <slot name="content"></slot>
  </Modal>
</template>

<script>

export default {
  name: "default",
  props: {
    show: {
      type: Boolean,
      default: true,
    },
    title: {
      type: String,
      default: "默认提示"
    },
    titleStyle: {
      type: String,
      default: ""
    },
    onOk: {
      type: Function,
      default: function () {
        this.$Message.success("确认！");
      }
    },
    iconType: {
      type:String,
      default:"ios-information-circle"
    },
    iconShow:{
      type: Boolean,
      default: true
    },
    makeTitle: {
      type: String,
      default: "默认提示"
    },
    okText: {
      type: String,
      default: "确认"
    },
    closeAble: {
      type: Boolean,
      default: true
    },
    maskCloseAble: {
      type: Boolean,
      default: false
    },
    cancelText: {
      type: String,
      default: "取消"
    },
    onCancel: {
      type: Function,
      default: function () {
        this.$Message.warning("取消！");
      }
    },
    footerHide: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style scoped>

</style>
